using System.Collections.Generic;
using NUnit.Framework;
using Sanelib.CodeMaker;
using Sanelib.CodeMaker.Generators;

namespace UnitTest.Common
{
    [TestFixture]
    public class GeneratorTester
    {
        [Test]
        public void Generate()
        {
            var generator = new Generator();
            generator.AppendNewEntity(new DatabaseTableSchema
            {
                TableName = "Folder",
                Description = "Health related table",
                IsAudited = true,
                Columns = new List<DatabaseTableColumnSchema>(new[]
                {
                    new DatabaseTableColumnSchema
                    {
                        PropertyName = "AccountId",
                        DataType = DataType.Guid,
                        PropertySize = 8,
                        IsNull = false
                    },
                    new DatabaseTableColumnSchema
                    {
                        PropertyName = "AccountType",
                        DataType = DataType.Enumeration,
                        PropertySize = 8,
                        IsNull = false
                    },
                    new DatabaseTableColumnSchema
                    {
                        PropertyName = "FileData",
                        DataType = DataType.Image,
                        PropertySize = 8,
                        IsNull = true
                    }
                })
            });
        }
    }
}